package com.itheima.d8_demo;


import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        GoldCard g = new GoldCard("622622", "张三", "19553755679", 5000);
        g.deposit(5000);
        pay(g);
        SilverCard s = new SilverCard("6226222", "张三11", "1955378", 2000);
        s.deposit(8000);
        pay(s);

    }


    public static void pay(Card c){
        System.out.println("请刷卡，请输入消费的金额：");
        Scanner sc = new Scanner(System.in);
        double money = sc.nextDouble();
        c.consume(money);
    }
}
